home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Report Writers / Crystal Repot 9.0 Full CD version / Setup.exe / SRC / HOARDDLL.ZIP / 3rdParty / hoard / libhoard-2.0.2 / config.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-06-18  |  3.2 KB  |  104 lines

  1. ///-*-C++-*-//////////////////////////////////////////////////////////////////
  2. //
  3. // Hoard: A Fast, Scalable, and Memory-Efficient Allocator
  4. //        for Shared-Memory Multiprocessors
  5. // Contact author: Emery Berger, http://www.cs.utexas.edu/users/emery
  6. //
  7. // Copyright (c) 1998-2000, The University of Texas at Austin.
  8. //
  9. // This library is free software; you can redistribute it and/or modify
  10. // it under the terms of the GNU Library General Public License as
  11. // published by the Free Software Foundation, http://www.fsf.org.
  12. //
  13. // This library is distributed in the hope that it will be useful, but
  14. // WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16. // Library General Public License for more details.
  17. //
  18. //////////////////////////////////////////////////////////////////////////////
  19.  
  20.  
  21. //////////////////////////////////////////////////////////////////////////////
  22. //
  23. // Note: This file was modified by Crystal Decisions in June 2002.
  24. //
  25. //////////////////////////////////////////////////////////////////////////////
  26.  
  27.  
  28. #ifndef _CONFIG_H_
  29. #define _CONFIG_H_
  30.  
  31. #ifndef _REENTRANT
  32. #define _REENTRANT        // If defined, generate a multithreaded-capable version.
  33. #endif
  34.  
  35. #ifndef USER_LOCKS
  36. #define USER_LOCKS 1        // Use our own user-level locks if they're available for the current architecture.
  37. #endif
  38.  
  39. #define HEAP_LOG 0        // If non-zero, keep a log of heap accesses.
  40.  
  41. // Customized version of the Hoard allocator for Crystal Decisions
  42. #define CRYSTAL_HOARD
  43. #undef  USER_LOCKS        // User-level locks can lead to thread starvation under heavy load
  44. #define USER_LOCKS 0
  45.  
  46. ///// You should not change anything below here. /////
  47.  
  48.  
  49. // The base of the exponential used for size classes.
  50. // An object is in size class i if
  51. //        base^(b+i-1) * ALIGNMENT < size <= base^(b+i) * ALIGNMENT,
  52. // where b = log_base(ALIGNMENT).
  53. // Note that this puts an upper-limit on internal fragmentation:
  54. //   if SIZE_CLASS_BASE is 1.2, then we will never see more than
  55. //   20% internal fragmentation (for aligned requests).
  56.  
  57. #define SIZE_CLASS_BASE 1.2
  58.  
  59. // The number of groups of superblocks we maintain based on what
  60. // fraction of the superblock is empty. NB: This number must be at
  61. // least 2, and is 1 greater than the EMPTY_FRACTION in heap.h.
  62.  
  63. enum { SUPERBLOCK_FULLNESS_GROUP = 5 };
  64.  
  65.  
  66. // DO NOT CHANGE THESE.  They require running of maketable to replace
  67. // the values in heap.cpp for the _numBlocks array.
  68.  
  69. #define HEAP_DEBUG 0        // If non-zero, keeps extra info for sanity checking.
  70. #define HEAP_STATS 0        // If non-zero, maintain blowup statistics.
  71. #define HEAP_FRAG_STATS 0    // If non-zero, maintain fragmentation statistics.
  72.  
  73.  
  74. // CACHE_LINE = The number of bytes in a cache line.
  75.  
  76. #ifdef i386
  77. #define CACHE_LINE 32
  78. #endif
  79.  
  80. #ifdef sparc
  81. #define CACHE_LINE 64
  82. #endif
  83.  
  84. #ifdef __sgi
  85. #define CACHE_LINE 128
  86. #endif
  87.  
  88. #ifndef CACHE_LINE
  89. // We don't know what the architecture is,
  90. // so go for the gusto.
  91. #define CACHE_LINE 64
  92. #endif
  93.  
  94. #ifdef __GNUG__
  95. // Use the max operator, an extension to C++ found in GNU C++.
  96. #define MAX(a,b) ((a) >? (b))
  97. #else
  98. #define MAX(a,b) (((a) > (b)) ? (a) : (b))
  99. #endif
  100.  
  101.  
  102. #endif // _CONFIG_H_
  103.  
  104.